﻿import orderControlUI from "../orderControlUI";
import GameModuleData from "./GameModuleData";
import GameModuleS from "./GameModuleS";

export default class GameModuleC extends ModuleC<GameModuleS, GameModuleData> {

    /**是先手还是后手（我希望他是一种状态） */
    private _isFirst = null;
    public get isFirst() {
        return this._isFirst;
    }
    public set isFirst(value) {
        this._isFirst = value;
        value ? this.orderUI.switchFirst() : this.orderUI.switchSecond();
    }


    /**是否在播放动画 */
    private curtween: Tween<any> = null;
    /**动画时间 */
    private animTime: number = 500;


    private orderUI: orderControlUI = null;
    /** 当脚本被实例后，会在第一帧更新前调用此函数 */
    protected async onStart() {
        this.orderUI = UIService.show(orderControlUI);
    }



    /**游戏开始 */
    public net_onGameStart(isFirst: boolean) {
        this.isFirst = isFirst;
    }
}